<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      h2 {
        text-align: center;
      }

      table {
        /* 合并相邻边框 */
        border-collapse: collapse;
        height: 80px;
        margin: 0 auto;
        text-align: center;
      }

      th {
        padding: 5px 30px;
      }

      table,
      th,
      td {
        border: 1px solid #000;
      }
    </style>
  </head>
  <body>
    <script>
      let price = prompt('请输入你的银行总额')
      let sf = prompt('请输入你的水费')
      let df = prompt('请输入你的电费')
      let wf = prompt('请输入你的网费')
      let sum = price - sf - df - wf
      document.write(` <table>
          <tr>
            <th>银行卡总额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>银行余额</th>
          </tr>
          <tr>
            <td> ${price} </td>
            <td>${sf}元</td>
            <td>${df}</td>
            <td>${wf}元</td>
            <td>${sum}</td>
          </tr>
        </table> `)
    </script>
  </body>
</html>
